project(AutopatcherMySQLRepository)
FINDMYSQL()
IF(WIN32 AND NOT UNIX)
	FILE(GLOB ALL_HEADER_SRCS *.h ${MySQLInterface_SOURCE_DIR}/MySQLInterFace.h ${Autopatcher_SOURCE_DIR}/ApplyPatch.h)
	FILE(GLOB ALL_CPP_SRCS *.cpp ${MySQLInterface_SOURCE_DIR}/MySQLInterFace.cpp ${Autopatcher_SOURCE_DIR}/ApplyPatch.cpp)
	include_directories(${RAKNETHEADERFILES} ./ ${MySQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${MYSQL_INCLUDE_DIR} ${BZip2_SOURCE_DIR}) 
	add_library(AutoPatcherMySQLRepository STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS} readme.txt)
	target_link_libraries (AutoPatcherMySQLRepository ${RAKNET_COMMON_LIBS} ${MYSQL_LIBRARIES})
	VSUBFOLDER(AutoPatcherMySQLRepository "Samples/AutoPatcher/Server/MySQL")
ELSE(WIN32 AND NOT UNIX)
	FILE(GLOB ALL_HEADER_SRCS *.h)
	FILE(GLOB ALL_CPP_SRCS *.cpp)
	include_directories(${RAKNETHEADERFILES} ./ ${MySQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${MYSQL_INCLUDE_DIR}) 
	add_library(AutoPatcherMySQLRepository STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
	target_link_libraries (AutoPatcherMySQLRepository ${RAKNET_COMMON_LIBS} LibAutopatcher LibMySQLInterface ${MYSQL_LIBRARIES})
ENDIF(WIN32 AND NOT UNIX)